当前位置:  开发笔记 > 编程语言 > 正文

Yii2 | 需要bower-asset/jquery

如何解决《Yii2|需要bower-asset/jquery》经验,为你挑选了2个好方法。

我正在尝试通过composer安装Yii2:

composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-basic basic

〜/ .composer/composer.json

{
    "require": {
    "fxp/composer-asset-plugin": "~1.1.1"
    }
}

结果:

Problem 1
- yiisoft/yii2 2.0.x-dev requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 dev-master requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yii2[2.0.5, 2.0.6, dev-master, 2.0.x-dev].

我做错了什么?



1> 小智..:
rm -rf ~/.composer/vendor
rm ~/.composer/composer.lock
cd ~/.composer
composer clear-cache
composer self-update
composer global require "fxp/composer-asset-plugin:^1.1.3"
composer install

然后转到您的工作目录并运行:

composer create-project --prefer-dist yiisoft/yii2-app-basic basic



2> Nick Tsai..:

您可以尝试更新的版本:

composer global require "fxp/composer-asset-plugin:^1.2.0"

然后:

composer create-project --prefer-dist yiisoft/yii2-app-basic basic

非安装Bower-Asset方式:

您可以从存档文件下载安装 Yii2 .通过这种方式,您将不需要处理Bower问题.

此外,如果您需要在不处理鲍尔更新作曲家,您可以要求yidas/yii2作曲家鲍尔跳过之前yiisoft/yii2composer.json文件中:

"require": {
    "php": ">=5.4.0",
    "yidas/yii2-composer-bower-skip": "~2.0.0",
    "yiisoft/yii2": "~2.0.5",
    "yiisoft/yii2-bootstrap": "~2.0.0"
}

相反,如果您想创建没有bower-asset问题的yii2项目:

yidas/yii2-app-basic:

composer create-project yidas/yii2-app-basic

yidas/yii2-app-advanced:

composer create-project yidas/yii2-app-advanced


从Yii 2.0.13开始,它使用Asset-Packagist解决方案而不是 fxp/composer-asset-plugin

推荐阅读
Life一切安好
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有